package net.keebook.webapp.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;

import net.keebook.webapp.util.AccessRight;
import net.keebook.webapp.util.ExposableId;


@Entity
public class KeeBookAccess implements Serializable, ExposableId {
	private static final long serialVersionUID = 2296778561584101278L;
	
	@EmbeddedId
	private KeeBookAccessPk pk = new KeeBookAccessPk();
	@Enumerated(EnumType.STRING)
	private AccessRight accessRight;
	@Column(unique=true)
	private String exposableId;

	private KeeBookAccessPk getPk() {
		return pk;
	}

	@SuppressWarnings("unused")
	private void setPk(KeeBookAccessPk pk) {
		this.pk = pk;
	}
	
	public User getUser() {
		return getPk().getUser();
	}
	public void setUser(User user) {
		getPk().setUser(user);
	}
	public KeeBook getKeeBook() {
		return getPk().getKeeBook();
	}
	public void setKeeBook(KeeBook keeBook) {
		getPk().setKeeBook(keeBook);
	}
	public AccessRight getAccessRight() {
		return accessRight;
	}
	public void setAccessRight(AccessRight accessRight) {
		this.accessRight = accessRight;
	}
	public String getExposableId() {
		return exposableId;
	}
	public void setExposableId(String exposableId) {
		this.exposableId = exposableId;
	}
}
